package com.xyyhome.web.love.domain;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Created by ty850 on 2017/5/21.
 */
@Entity
@Table(name = "y_l_dynamic_comment")
public class YLDynamicComment {
    private String yldcId;
    private String yldcDynamicId;
    private String yldcUserId;
    private String yldcParentId;
    private String yldcReplyUserId;
    private String yldcContent;
    private Date yldcCreateTime;
    private Byte yldcState;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "yldc_id", nullable = false, length = 36)
    public String getYldcId() {
        return yldcId;
    }

    public void setYldcId(String yldcId) {
        this.yldcId = yldcId;
    }

    @Basic
    @Column(name = "yldc_dynamic_id", nullable = true, length = 36)
    public String getYldcDynamicId() {
        return yldcDynamicId;
    }

    public void setYldcDynamicId(String yldcDynamicId) {
        this.yldcDynamicId = yldcDynamicId;
    }

    @Basic
    @Column(name = "yldc_user_id", nullable = true, length = 36)
    public String getYldcUserId() {
        return yldcUserId;
    }

    public void setYldcUserId(String yldcUserId) {
        this.yldcUserId = yldcUserId;
    }

    @Basic
    @Column(name = "yldc_parent_id", nullable = true, length = 36)
    public String getYldcParentId() {
        return yldcParentId;
    }

    public void setYldcParentId(String yldcParentId) {
        this.yldcParentId = yldcParentId;
    }

    @Basic
    @Column(name = "yldc_reply_user_id", nullable = true, length = 36)
    public String getYldcReplyUserId() {
        return yldcReplyUserId;
    }

    public void setYldcReplyUserId(String yldcReplyUserId) {
        this.yldcReplyUserId = yldcReplyUserId;
    }

    @Basic
    @Column(name = "yldc_content", nullable = true, length = 200)
    public String getYldcContent() {
        return yldcContent;
    }

    public void setYldcContent(String yldcContent) {
        this.yldcContent = yldcContent;
    }

    @Basic
    @Column(name = "yldc_create_time", nullable = true)
    public Date getYldcCreateTime() {
        return yldcCreateTime;
    }

    public void setYldcCreateTime(Date yldcCreateTime) {
        this.yldcCreateTime = yldcCreateTime;
    }

    @Basic
    @Column(name = "yldc_state", nullable = true)
    public Byte getYldcState() {
        return yldcState;
    }

    public void setYldcState(Byte yldcState) {
        this.yldcState = yldcState;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        YLDynamicComment that = (YLDynamicComment) o;

        if (yldcId != null ? !yldcId.equals(that.yldcId) : that.yldcId != null) return false;
        if (yldcDynamicId != null ? !yldcDynamicId.equals(that.yldcDynamicId) : that.yldcDynamicId != null)
            return false;
        if (yldcUserId != null ? !yldcUserId.equals(that.yldcUserId) : that.yldcUserId != null) return false;
        if (yldcParentId != null ? !yldcParentId.equals(that.yldcParentId) : that.yldcParentId != null) return false;
        if (yldcReplyUserId != null ? !yldcReplyUserId.equals(that.yldcReplyUserId) : that.yldcReplyUserId != null)
            return false;
        if (yldcContent != null ? !yldcContent.equals(that.yldcContent) : that.yldcContent != null) return false;
        if (yldcCreateTime != null ? !yldcCreateTime.equals(that.yldcCreateTime) : that.yldcCreateTime != null)
            return false;
        if (yldcState != null ? !yldcState.equals(that.yldcState) : that.yldcState != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = yldcId != null ? yldcId.hashCode() : 0;
        result = 31 * result + (yldcDynamicId != null ? yldcDynamicId.hashCode() : 0);
        result = 31 * result + (yldcUserId != null ? yldcUserId.hashCode() : 0);
        result = 31 * result + (yldcParentId != null ? yldcParentId.hashCode() : 0);
        result = 31 * result + (yldcReplyUserId != null ? yldcReplyUserId.hashCode() : 0);
        result = 31 * result + (yldcContent != null ? yldcContent.hashCode() : 0);
        result = 31 * result + (yldcCreateTime != null ? yldcCreateTime.hashCode() : 0);
        result = 31 * result + (yldcState != null ? yldcState.hashCode() : 0);
        return result;
    }
}
